<?php

/**
 * The doc controller handles generating and rendering the CMS documentation
 *
 * @author Forrest
 */
class DigDoc_IndexController extends Zend_Controller_Action {
    /**
     * the index action renders the documentation browser
     */
    public function indexAction() {
        DigUi_Service_Template::useAdminTemplate();
        $classIndex = array();
        foreach (Dig_Service_Module::listAll() as $module => $config) {
            $classIndex[$module] = Dig_Service_Module::getClassIndex($module);
        }
        $this->view->classIndex = $classIndex;
    }

    /**
     * the inspect action loads and renders the class inspector
     *
     * this method uses Zend_Reflection to inspect the specified class
     * and then renders a detailed class inspector and the source code
     * 
     * @example /digDoc/index/inspect/class/Dig_DocController
     * 
     * @param string $class, the classname to inspect
     * 
     */
    public function inspectAction() {
        $class = $this->getRequest()->getParam('class', null);
        $this->view->class = Dig_Service_Module::inspect($class);
    }
}
?>
